#include <algorithm>
#include "MaxFilter.h"

void
MaxFilter::help(std::string &buf) const
{
    buf.append("最大值滤波器;适合处理胡椒噪声.\n");
    Filter::help(buf);
    return ;
}

double
MaxFilter::operOnNeigh(const cv::Mat &neigh)
{
    return *std::max_element(neigh.begin<uchar>(),neigh.end<uchar>());
}

NOISE_ALGO_REGISTER("MaxFilter",MaxFilter);


